<%--
SYSTEM NAME 	: 기술적보호조치표준서비스
PROGRAM ID 		: pesFormUpdate
PROGRAM NAME 	: 권리자 리스트
AUTHOR 			: 강평희
CREAT DATE 		: 2010-09-01
MODIFY DATE		: 
DESCRIPTION 	: 권리자 비번 변경 페이지
--%>
<%@ page language="java"
	import="java.sql.*,javax.sql.*,java.util.*,java.io.*,javax.naming.*"
	pageEncoding="UTF-8"%>
<%@ page import="com.markany.beans.util.*"%>
<%@ page import="com.markany.beans.property.*"%>
<%@ page import="com.markany.beans.src.MasterDao"%>
<%@ page import="org.apache.log4j.Logger"%>
<%! private Logger logger = Logger.getLogger(this.getClass().getName()); %>
<%
	//서버패스 잡기
	String ctxPath = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + ctxPath + "/ctis_mng";
	
	String PAGE = "pesFormUpdate";
	String DIR = "perfomance";
	String PAGE_NAME = "권리자 목록";
	String NAV = "Home > 성능평가 > 성능평가 업체 비번 변경";
%>
<%@ include file="/jsp/common/ctis_sessinc.jsp" %>
<%
	String receipt_no = hp.getString("receipt_no","");	
	String testGb = hp.getString("testGb","");
	String receiptMemo = hp.getString("receipt_memo","");
	String receiptMemosql = "";
	
	if( !receiptMemo.equals("") ){
		
		receiptMemosql = " RECEIPT_MEMO = '"+receiptMemo+"'";
	}
	
	
	String pwd = hp.getString("PWD1","");
	String pwd2 = hp.getString("PWD2","");
	
	pwd = CommonUtil.md5String(pwd);
	
	
	MasterDao dao = null;
	
	String sql = "";
	String errorMsg = "";
	
    Vector list = null;

		try
		{
			dao = new MasterDao();
			dao.startTransaction(2);
			
			if( pwd.equals("") && pwd2.equals("") ){
				sql = "UPDATE TAB_TEST_1 SET ";
			}
			else{
				sql = "UPDATE TAB_TEST_1 SET PWD = '"+pwd+"', ";	
			}
			if(!receiptMemosql.equals("")) sql += receiptMemosql;
			sql+= " WHERE RECEIPT_NO = '"+receipt_no+"'";
			
			dao.setCommand(sql);
			
			int rtnval = 0;
				
			rtnval = dao.execute();	
				
			dao.endTransaction(true);		
				
		}
		catch(Exception e)
		{
			dao.rollback();
			logger.error(PAGE + " Exception e.toString()      : " + e.toString());
			logger.error(PAGE + " Exception e.getMessage()    : " + e.getMessage());
			logger.error(PAGE + " Exception strQuery  : \n" + sql);
		}
		finally
		{
			dao.close();	
		}	
	
 %>
 <script type="text/javascript">
	<!--
		var testGb = "<%=testGb%>";
		if(testGb == 'FF') location.href = "pesResult.jsp?testGb="+testGb;
		else               location.href = "pesResultWF.jsp?testGb="+testGb;
	//-->
</script>
 
